<?php
declare(strict_types = 1);
namespace app\api\controller;

use AlibabaCloud\Client\Request\Request;
use app\BaseController;

class Login extends BaseController{

    public function index(Request $request):object{

        #接收数据
        $phoneNumber = $this->request->param("phone_number");
        $code = input("param.code",0, "intval");
        $type = input("param.type",0, "intval");

        #数据验证
        $data = [
            'phone_number' => $phoneNumber,
            'code' => $code,
            'type' => $type,
        ];
        // ....

        #
        $result = (new \app\common\business\User())->login();
        if ($result) {
            return show();
        }

        return show(config("status.error"),'登录失败!');


    }


}
